//
//  CMVideoDownloader.h
//  Cheer
//
//  Created by YIDAOMAC on 2024/1/12.
//

#import <AVKit/AVKit.h>

NS_ASSUME_NONNULL_BEGIN

///视频下载主键，主要是为了实现边下载边播放的
@interface CMVideoDownloader : NSObject<AVAssetResourceLoaderDelegate>

///视频资源
@property(nonatomic, readonly) AVURLAsset *asset;

///初始化
+ (instancetype)downloaderWithURL:(NSURL*) URL;
- (instancetype)initWithURL:(NSURL*) URL;

///取消
- (void)cancel;

///恢复下载
- (void)resume;

///暂停下载
- (void)pause;

@end

NS_ASSUME_NONNULL_END
